package student.stu23002121.chapter10;

import java.io.FileOutputStream;
import java.io.OutputStream;

public class Demo10 {public static void main(String[] args) throws Exception {
    // 创建一个文件字节输出流，并指定输出文件名称
    OutputStream out = new FileOutputStream("src//student//stu23002121//chapter10//example.txt");
    String str = "itcast";
    byte[] b = str.getBytes();
    for (int i = 0; i < b.length; i++) {
        out.write(b[i]);
    }
    out.close();
}
}
